package com.example.siyun.service.impl.permissionsserviceimpl;

import com.example.siyun.mapper.permissionsmapper.FeedbacklistMapper;
import com.example.siyun.pojo.FeedBackList;
import com.example.siyun.service.permissionsservice.FeedbacklistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @Auther: 全
 * @Date: 2022/9/26 09:33
 * @Description:权限管理模块反馈管理里面的反馈列表
 */
@Service
public class FeedbacklistServiceImpl implements FeedbacklistService {
    @Autowired
    private FeedbacklistMapper feedbacklistMapper;
    /**
     * 获取反馈列表的信息
     * @return 反馈反馈列表的信息
     */
    @Transactional
    @Override
    public List<FeedBackList> getFeedBackList(FeedBackList feedbacklist,int acceptstate1,int acceptstate2) {
        return feedbacklistMapper.getFeedBackList(feedbacklist,acceptstate1,acceptstate2);
    }
    @Transactional
    @Override
    public Map<String, Object> selectFeedState(int acceptstate1,int acceptstate2) {
        Map map=new HashMap();
        Integer selectdsh = feedbacklistMapper.selectDsh(acceptstate1);
        Integer selectycl=feedbacklistMapper.selectYcl(acceptstate2);
        map.put("selectdsh",selectdsh);
        map.put("selectycl",selectycl);
        return map;
    }
    /**
     * 通过id修改反馈列表的反馈状态
     * @param  id 要修改反馈列表的id
     */
    @Transactional
    @Override
    public void setAcceptState(int id,int acceptstate) {
        feedbacklistMapper.setAcceptState(id,acceptstate);
    }
    /**
     * 通过id查询对应的列表数据
     * @param  id 要查询的列表的id
     */
    @Transactional
    @Override
    public FeedBackList selectFeedBackById(int id) {
        return feedbacklistMapper.selectFeedBackById(id);
    }
}
